package com.bolao;

import com.bolao.bets.BetsParentFragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class SectionsPagerAdapter extends FragmentPagerAdapter {

	private Context mContext;
	public SectionsPagerAdapter(FragmentManager fm, Context c) {
		super(fm);
		mContext = c;
	}
	
	@Override
	public Fragment getItem(int position) {
		Fragment fragment;
		switch (position){
		case 0: 
			fragment = new BetsParentFragment();
		break;
		case 1: 
			fragment = new NewsFragment();
		break;
		case 2: 
			fragment = new GroupsFragment();
		break;
		default: 
			fragment = new BuildingFragment();
		break;
		}
		Bundle args = new Bundle();
		fragment.setArguments(args);
		return fragment;
	}

	@Override
	public int getCount() {
		// Show 3 total pages.
		return 4;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		switch (position) {
		case 0:
			return mContext.getResources().getString(R.string.bets);
		case 1:
			return mContext.getResources().getString(R.string.news);
		case 2:
			return mContext.getResources().getString(R.string.groups);
		case 3:
			return mContext.getResources().getString(R.string.simulator);
		}
		return null;
	}


}

